package com.ipartek.desarrollo.beanHibernate;

// Generated 26-feb-2014 21:38:33 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Envios generated by hbm2java
 */
@Entity
@Table(name = "envios")
public class Envios implements java.io.Serializable {

	private EnviosId id;
	private Newsletters newsletters;
	private Subscriptores subscriptores;
	private Date fechaEnvio;

	public Envios() {
	}

	public Envios(EnviosId id, Newsletters newsletters,
			Subscriptores subscriptores) {
		this.id = id;
		this.newsletters = newsletters;
		this.subscriptores = subscriptores;
	}

	public Envios(EnviosId id, Newsletters newsletters,
			Subscriptores subscriptores, Date fechaEnvio) {
		this.id = id;
		this.newsletters = newsletters;
		this.subscriptores = subscriptores;
		this.fechaEnvio = fechaEnvio;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idNewsletter", column = @Column(name = "idNewsletter", nullable = false)),
			@AttributeOverride(name = "idSubscriptor", column = @Column(name = "idSubscriptor", nullable = false)) })
	public EnviosId getId() {
		return this.id;
	}

	public void setId(EnviosId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idNewsletter", nullable = false, insertable = false, updatable = false)
	public Newsletters getNewsletters() {
		return this.newsletters;
	}

	public void setNewsletters(Newsletters newsletters) {
		this.newsletters = newsletters;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idSubscriptor", nullable = false, insertable = false, updatable = false)
	public Subscriptores getSubscriptores() {
		return this.subscriptores;
	}

	public void setSubscriptores(Subscriptores subscriptores) {
		this.subscriptores = subscriptores;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FechaEnvio", length = 19)
	public Date getFechaEnvio() {
		return this.fechaEnvio;
	}

	public void setFechaEnvio(Date fechaEnvio) {
		this.fechaEnvio = fechaEnvio;
	}

}
